package com.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/hello")
public class HelloController {
    @GetMapping("/{name}")
    @ResponseBody
    public String hi(@PathVariable String name){
        return "hello"+name;
    }

    @GetMapping("/x")
    @ResponseBody
    public String hi2( String name){
        return "hello"+name;
    }

    @GetMapping("/say")
    @ResponseBody
    public String say(@RequestParam(value = "username",required = false) String name){
        return "hello"+name;
    }

}
